Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update user api #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix/update user api #97

wants to merge 3 commits into from

Conversation

Ugholaf
Copy link
Contributor

@Ugholaf Ugholaf commented Nov 10, 2023

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Summary of PR

Details

#10

[Optional] Screenshots, Recordings

@Ugholaf Ugholaf requested review from rexong and JovonLim November 10, 2023 18:45
@rexong
Copy link
Contributor

rexong commented Nov 10, 2023

why need to update user api here?

return c.JSON(http.StatusInternalServerError, message.CreateErrorMessage("Error marshalling request body"))
}

resp, err := http.Post(os.Getenv("USER_SERVICE_URL") + "/users/" + strconv.FormatUint(uint64(authId), 10), "application/json", bytes.NewBuffer(requestBodyJSON))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be posting to the url, it should be forwarding.

@@ -26,7 +26,7 @@ func main() {
e.POST("/users", handlers.CreateUser)
e.GET("/users", handlers.GetUsers)
e.GET("/users/:id", handlers.GetUser)
e.PUT("/users/:id", handlers.UpdateUser)
e.POST("/users/:authId", handlers.UpdateUser)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id has to be removed as a whole, if cannot fix then never mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants